﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CellVoltage.aspx.cs" Inherits="GroundWater.waterlevel.CellVoltage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="../ext.css" type="text/css" rel="Stylesheet" />
    
    <script language="javascript" src="../js/common.js" type="text/javascript"></script>
    <script language="javascript" src="../js/jquery.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
    
    <link media=all href="../js/resources/_Common/Common.css" type=text/css rel=stylesheet>
    <link media=all href="../js/resources/_Loadding/Loadding.css" type=text/css rel=stylesheet>
    <link media=all href="../js/resources/_Panel/Panel.css" type=text/css rel=stylesheet>
    <link media=all href="../js/resources/_Button/Button.css" type=text/css rel=stylesheet>
    <link media=all href="../js/resources/_TextBox/TextBox.css" type=text/css rel=stylesheet>
</head>
<body>
    <form id="form1" runat="server"><asp:ScriptManager ID="scriptManager" runat="server" />
    <!-- 面板内容 -->                
<div id=bodyPanel style="width:97%; margin-right:8px;">
<div class=x-pne id=panel style="WIDTH: 100%;">
    <div class="corner-bg x-pne-lt x-pne-left">
    <div class="corner-bg x-pne-rt x-pne-right">
    <div class="corner-bg x-pne-t">
    <div class="x-pne-caption font">查询条件</div>
    </div>
    </div>
    </div>
    
    <div>
    <div class="side-bg x-pne-l">
    <div class="side-bg x-pne-r">
    <div class="x-pne-c" style="WIDTH: 100%; HEIGHT: 38px">
    <div id="contentPanel"><!-- 控件实例 -->

    <div class="gbPanel"><%--onselectedindexchanged="drpWell_SelectedIndexChanged"--%>
        <table class="font">
        <tbody>
        <tr>
            <td>日期从:</td><td><input class="textField text-bg border-blur" id="txtStartDate"  type="text" maxlength="16" runat="server" />&nbsp;<img onclick="WdatePicker({el:$dp.$('txtStartDate')})" src="../js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle" /></td>
            <td>到:</td><td><input class="textField text-bg border-blur" id="txtEndDate"  type="text" maxlength="16" runat="server"/>&nbsp;<img onclick="WdatePicker({el:$dp.$('txtEndDate')})" src="../js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle" /></td>
            <td style="padding-left:30px;">
                <div>
                    <div class="btn-side btn-bg" style="background-position: 0% 0%"></div>
                    <div class="btn-body btn-bg" style="background-position: 0px 168px; WIDTH: 60px"><asp:Button ID="btnQuery" runat="server" Text="查　询" CssClass="font" onclick="btnQuery_Click" OnClientClick="if(!isDate(txtStartDate) || !isDate(txtEndDate)) { alert('日期格式不正确！'); return false; }" /></div>  <%--<button id="btnQuery" name="btnQuery" class=font type=button runat="server" onclick="__doPostBack(this, null);">查　询</button>--%>
                    <div class="btn-side btn-bg" style="background-position: 0px 189px"></div>
                </div>
            </td>
            <td style="padding-left:30px;">
                <div>
                    <div class="btn-side btn-bg" style="background-position: 0% 0%"></div>
                    <div class="btn-body btn-bg" style="background-position: 0px 168px; WIDTH: 60px"><asp:Button ID="btnLast" runat="server" Text="最  新" CssClass="font" onclick="btnLast_Click" OnClientClick="if(!isDate(txtStartDate) || !isDate(txtEndDate)) { alert('日期格式不正确！'); return false; }" /></div>  <%--<button id="btnQuery" name="btnQuery" class=font type=button runat="server" onclick="__doPostBack(this, null);">查　询</button>--%>
                    <div class="btn-side btn-bg" style="background-position: 0px 189px"></div>
                </div>
            </td>
            <td style="padding-left:30px;">
                <div>
                    <div class="btn-side btn-bg" style="background-position: 0% 0%"></div>
                    <div class="btn-body btn-bg" style="background-position: 0px 168px; WIDTH: 60px"><asp:Button ID="btnOK" runat="server" Text="  导出  " CssClass="font" OnClick="btnExport_Click" OnClientClick="if(!isDate(txtStartDate) || !isDate(txtEndDate)) { alert('日期格式不正确！'); return false; }" /></div>  <%--<button id="btnQuery" name="btnQuery" class=font type=button runat="server" onclick="__doPostBack(this, null);">查　询</button>--%>
                    <div class="btn-side btn-bg" style="background-position: 0px 189px"></div>
                </div>
            </td>
        </tr>
        </tbody>
        </table>
    </div>

    </div>
    </div>
    </div>
    </div>
    <div class="corner-bg x-pne-lb x-pne-left">
        <div class="corner-bg x-pne-rb x-pne-right">
            <div class="corner-bg x-pne-b"></div>
        </div>
    </div>
    </div>
</div>
</div>
<asp:ObjectDataSource ID="odsWells" runat="server" SelectMethod="GetAll" TypeName="GroundWater.BusinessActions.Well" >
    <SelectParameters>
        <asp:Parameter Name="isStoredProc" Type="Boolean" DefaultValue="False" />
        <asp:Parameter Name="enableCache" Type="Boolean" DefaultValue="True" />
    </SelectParameters>
    </asp:ObjectDataSource>

<!-- 面板内容结束 -->
<asp:ObjectDataSource ID="odsLastMonitoring" runat="server" SelectMethod="FetchWaterLeveLast"  TypeName="GroundWater.BusinessActions.Monitoring"  >
    <SelectParameters>
        <asp:Parameter Name="date" Type="String" DefaultValue="Now" />
        <%--<asp:Parameter Name="enableCache" Type="Boolean" DefaultValue="False" />--%>
    </SelectParameters>
</asp:ObjectDataSource>
    
 <asp:ObjectDataSource id="odsMonitoring" runat="server" EnablePaging="True" 
     TypeName="GroundWater.BusinessActions.Monitoring" 
     SelectMethod="FetchByDatePaged" SelectCountMethod="FetchByDateRowCount"
     SortParameterName="sortExpression">
    <SelectParameters>
    <asp:ControlParameter ControlID="txtStartDate" PropertyName="Value" Name="startDate" />
    <asp:ControlParameter ControlID="txtEndDate" PropertyName="Value" Name="endDate" />
      <%--<asp:Parameter Name="wellCode" Type="String"  />
      <asp:Parameter Name="whereClause" Type="String" />
      <asp:Parameter Name="whereClause" Type="String" />
      <asp:Parameter Name="whereClause" Type="String" />--%>
    </SelectParameters>
</asp:ObjectDataSource>

    <div style="width:100%; margin-top:10px;">
        <p style="font-weight:bold; font-family:Tahoma; margin-bottom:8px; "></p>
        <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        <asp:Panel ID="upAll" runat="server" CssClass="grid" Visible="false">
            <div class="rounded">
                <div class="top-outer"><div class="top-inner"><div class="top">
                    <h2>电池电压 </h2>
                </div></div></div>
                <div class="mid-outer"><div class="mid-inner"><div class="mid">     
                
                    <!-- Content Goes Here! -->
                    
                            <asp:GridView   ID="gvMonitoring" runat="server" DataSourceID="odsMonitoring" SkinID="PagingGridView"  OnRowDataBound="RowDataBound">
                                <Columns>
                                    <asp:BoundField  HeaderText="水井名称" DataField="WellName" SortExpression="WSWLNM" HeaderStyle-CssClass="first" ItemStyle-CssClass="first" />
                                    <asp:BoundField  HeaderText="检测时间" DataField="MonitorTime"   SortExpression="MNTM"  DataFormatString="{0:yyyy-MM-dd HH:mm}" HtmlEncode="false" />
                                    <asp:BoundField  HeaderText="电池电压" DataField="CellVoltage"   SortExpression="CELL" DataFormatString="{0:N2}"   />
                                    <asp:BoundField  HeaderText="卡号"     DataField="SIMCard"       SortExpression="COMMNO"  />
                                    <asp:BoundField  HeaderText="设备地址" DataField="BTUAddress"    SortExpression="CONTROLLERID"   />
                                    <asp:BoundField  HeaderText="剖面"     DataField="SectionPlane"   SortExpression="NT"  />
                                </Columns>
                            </asp:GridView>   
                                          
    
                </div></div></div>
            <div class="bottom-outer"><div class="bottom-inner">
            <div class="bottom"></div></div></div>                   
        </div>      
        </asp:Panel>
        </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnQuery" />
        </Triggers>
    </asp:UpdatePanel>  
                     
        <p style="font-weight:bold; font-family:Tahoma; margin-bottom:8px; "></p>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
        <asp:Panel ID="upToday" runat="server" CssClass="grid">
            <div class="rounded">
                <div class="top-outer"><div class="top-inner"><div class="top">
                    <h2>最新的电池电压</h2>
                </div></div></div>
                <div class="mid-outer"><div class="mid-inner"><div class="mid">     
                
                    <!-- Content Goes Here! -->
                    
                            <asp:GridView  ID="gvToday" runat="server"   DataSourceID="odsLastMonitoring"  SkinID="DefaultGridView"  OnRowDataBound="RowDataBound">
                                <Columns>
                                    <asp:BoundField  HeaderText="水井名称" DataField="WellName" SortExpression="WellName" HeaderStyle-CssClass="first" ItemStyle-CssClass="first" />
                                    <asp:BoundField  HeaderText="检测时间" DataField="MonitorTime"   SortExpression="MonitorTime"  DataFormatString="{0:yyyy-MM-dd HH:mm}" HtmlEncode="false"  />
                                    <asp:BoundField  HeaderText="电池电压" DataField="CellVoltage"   SortExpression="CellVoltage"    />
                                    <asp:BoundField  HeaderText="卡号"     DataField="SIMCard"       SortExpression="SIMCard"  />
                                    <asp:BoundField  HeaderText="设备地址" DataField="BTUAddress"    SortExpression="BTUAddress"   />
                                    <asp:BoundField  HeaderText="剖面"     DataField="SectionPlane"   SortExpression="SectionPlane"  />
                                </Columns>
                            </asp:GridView>   
                                         
    
                </div></div></div>
            <div class="bottom-outer"><div class="bottom-inner">
            <div class="bottom"></div></div></div>                   
        </div>      
        </asp:Panel>
            </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnQuery" />
        </Triggers>
    </asp:UpdatePanel>
                    
    </div>
    </form>
    
    <script type="text/javascript">
        //<![CDATA[
        jQuery(document).ready(function() {

            jQuery.each(jQuery("input", jQuery(".gbPanel")), function() {
                jQuery(this).bind("mousemove", function() {
                    var center = this.parentNode;
                    center.previousSibling.style.backgroundPosition = "0px 147px";
                    center.style.backgroundPosition = "0px 105px";
                    center.nextSibling.style.backgroundPosition = "0px 126px";
                });
                jQuery(this).bind("mouseout", function() {
                    var center = this.parentNode;
                    center.previousSibling.style.backgroundPosition = "";
                    center.style.backgroundPosition = "0px 168px";
                    center.nextSibling.style.backgroundPosition = "0px 189px";
                });


            }, null);

            jQuery("#drpWell").change(function() {
                if (this.selectedIndex == 0) {
                    //__doPostBack('drpWell', '');
                    setTimeout(__doPostBack, 0);
                }
            });
        });
        //]]>
        function btnQuery_onclick() {

        }

    </script>
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
</body>
</html>
